<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <include file="Pub:head"/>
</head>
<body>
<table class="tableStyle">
    <tr>
        <td colspan="2"> 您现在访问的是：任务的详细信息</td>
    </tr>

    <tr>
        <td width="15%" class="light">项目编号:</td>
        <td width="85%">{$data['projectid']}</td>
    </tr>

    <tr>
        <td width="15%" class="light">项目名称:</td>
        <td width="85%">{$data['name']}</td>
    </tr>

    <tr>
        <td width="15%" class="light">负责人:</td>
        <td width="85%">{$data['taker']}</td>
    </tr>

    <tr>
        <td width="15%" class="light">创建日期:</td>
        <td width="85%">{$data['createtime']}</td>
    </tr>
    <tr>
        <td width="15%" class="light">截止日期:</td>
        <td width="85%">{$data['deadline']}</td>
    </tr>
    <tr>
        <td width="15%" class="light">开始日期:</td>
        <td width="85%">{$data['begintime']}</td>
    </tr>
    <tr>
        <td width="15%" class="light">完成日期:</td>
        <td width="85%">{$data['finishtime']}</td>
    </tr>

    <tr>
        <td width="15%" class="light">任务类型:</td>
        <td width="85%">{$data['tasktype']}</td>
    </tr>
    <tr>
        <td width="15%" class="light">创建者:</td>
        <td width="85%">{$data['creatername']}</td>
    </tr>
    <tr>
        <td width="15%" class="light">资料:</td>
        <td width="85%">{$data['note']}</td>
    </tr>
    <tr>
        <td width="15%" class="light">完工资料:</td>
        <td width="85%">
            <?php
       echo
html_entity_decode(htmlspecialchars_decode($data['result']));
  ?>
        </td>
    </tr>


    <tr>
        <td colspan="2">
            <script language="javascript" type="text/javascript">
                function sendmail(taskid) {
                    $.post("__URL__/sendmail/", "taskid=" + taskid,
                            function (data, status) {
                                alert(data);
                            });
                }
                function taketask(taskid) {
                    $.post("__URL__/taketask/", "taskid=" + taskid,
                            function (data, status) {
                                alert(data);
                            });
                }
            </script>
            <a href="javascript:void(0);" onclick="sendmail({$data['id']});">发送通知</a>
            <?php

             switch($data["status"])
            {
            case "0":
              ?>
            <a href="javascript:void(0);" onclick="taketask({$data['id']});">领取当前任务</a>
                <?php
            break;
           case "1":
              $url=U("create" ,array("id"=>$data['id']));
                echo " <a href='$url'>创建子任务</a>";
                echo ' <a href="'.U('task/taskfinish',array('id'=>$data['id'])).'">完成任务</a>';
                break;
            case "2":
                echo "已完成";
                break;
            default:
                echo "未生效";
                break;
            }
            ?>
        </td>

    </tr>


</table>


</body>
</html>